package cn.wxq.daily.empdailymgforserve.controller;
import cn.wxq.daily.empdailymgforserve.domain.ReimbursementAudit;
import cn.wxq.daily.empdailymgforserve.model.Result;
import cn.wxq.daily.empdailymgforserve.model.StatusCode;
import cn.wxq.daily.empdailymgforserve.service.ReimbursementAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@CrossOrigin //跨越处理
@RestController
@RequestMapping("/reimbursementAudit")
@Api(value = "ReimbursementAuditController|费用审核")
public class ReimbursementAuditController {

    @Autowired
    private ReimbursementAuditService reimbursementAuditService;


    @RequestMapping(value = "/insertAuditInfo", method = RequestMethod.POST)
    @ApiOperation(value = "费用审核")
    public Result insertAuditInfo(ReimbursementAudit reimbursementAudit) {
        int row = reimbursementAuditService.insertAuditInfo(reimbursementAudit);
        if (row > 0) {
            return new Result(true, StatusCode.OK, "审核成功");
        } else {
            return new Result(false, StatusCode.ERROR, "返回数据异常");
        }

    }
}
